package cn.rjzjh.tapestry.component.tools.convert;

import org.apache.tapestry5.ioc.Messages;

import cn.rjzjh.commons.util.callback.IConvertValue;

/*****
 * 枚举类型的国际化转换类
 * 
 * @author Administrator
 * 
 * @param <T>
 */
public class ConvertValueEnum implements IConvertValue {
	private final Class entityClass;
	private final Messages messages;

	public ConvertValueEnum(Class entityClass, Messages messages) {
		this.entityClass = entityClass;
		this.messages = messages;
	}

	@Override
	public String getStr(String key) {
		String keytrue = entityClass.getName() + "." + key;
		return messages.get(keytrue);
	}

}
